<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<script type="text/javascript">
    function uploadUpdateCatelogLogo(){
        var fileObj = document.getElementsByName("updateCatelogLogoFile")[0].files[0];
        if(fileObj && fileObj.size > 0){
            var formData = new FormData();
            formData.append("logoFile", fileObj); //加入文件对象
            console.log(formData);
            $.ajax({
                type:"POST",
                url:"${pageContext.request.contextPath}/back/file/uploadPicture",
                data:formData,
                processData:false,
                contentType:false,
                success:function(data){
                    console.log(data.message);
                    $("#picture").attr("src",data.message);
                }
            });
        }
    }
</script>
<form id="updateCatelogForm" method="post" enctype="multipart/form-data" style="text-align: center;margin-top: 30px;" class="easyui-form">
    <table  style="display: inline;">

        <tr style="display: none">
            <td>编号:</td>
            <td><input id="catelogId" class="easyui-textbox" name="id" data-options="width:250,height:40,readonly:true" /></td>
        </tr>
        <tr>
            <td>名称:</td>
            <td><input class="easyui-textbox" name="name" data-options="width:250,height:40,required:true" /></td>
        </tr>
        <tr>
            <td>图片:</td>
            <td><br/><br/>
                <input id="cateloglogoPath" name="picture" type="hidden"/>
                <img style='width:80px;height:80px;border-radius:50%;display:block;' id="picture"/><br/>
                <input id="pictureFile" class="easyui-filebox" name="updateCatelogLogoFile" data-options="width:250,height:40,onChange:uploadUpdateCatelogLogo,buttonText:'选择文件'" />
            </td>
        </tr>
        <tr>
            <td>选择所属分类:</td>
            <td><input id="ctUpdateCatelog" name="parentid" /></td>
        </tr>
    </table>


</form>
